import { RouteRecordRaw } from "vue-router";
import AdminLayout from "@/layout/admin/Index.vue";
/*
 * @Description:
 * @Author: 胡涛
 * @Date: 2023-06-06 09:09:13
 * @LastEditors: 胡涛
 * @LastEditTime: 2024-07-20 00:28:18
 */
export const routes: Array<RouteRecordRaw> = [
  {
    path: "/login",
    component: () => import("@/views/login/Index.vue"),
    meta: {
      permissionCode: "",
      allowAnonymous: true,
      title: "用户登录",
    },
  },
  {
    path: "/",
    component: AdminLayout,
    redirect: "/data-board/overview",
    meta: {
      permissionCode: "",
      title: "管理布局页",
    },
    children: [
      {
        component: () => import("@/views/dashborad/Index.vue"),
        path: "index",
        meta: {
          permissionCode: "",
          title: "首页",
        },
      },
      {
        path: "/system/",
        redirect: "user",
        meta: {
          permissionCode: "",
          title: "系统管理",
        },
        children: [
          {
            path: "user",
            component: () => import("@/views/system/user/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.SystemUser",
              title: "用户管理",
            },
          },
          {
            path: "role",
            component: () => import("@/views/system/role/Index.vue"),
            meta: {
              permissionCode: "AbpIdentity.Roles",
              title: "角色管理",
            },
          },
          {
            path: "menu",
            component: () => import("@/views/system/menu/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.SystemMenu",
              title: "菜单管理",
            },
          },
          {
            path: "dictionary",
            component: () => import("@/views/system/dictionary/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Dictionary",
              title: "数据字典",
            },
          },
          {
            path: "region",
            component: () => import("@/views/system/region/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Region",
              title: "行政区域",
            },
          },
          {
            path: "config/category",
            component: () => import("@/views/system/config-category/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.ConfigDefine",
              title: "配置定义",
            },
          },
          {
            path: "config/setting",
            component: () => import("@/views/system/config-setting/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.ConfigSetting",
              title: "配置管理",
            },
          },
          {
            path: "setting",
            component: () => import("@/views/system/setting/Index.vue"),
            meta: {
              permissionCode: "",
              title: "系统设置",
            },
          },
        ],
      },
      {
        path: "/resource/",
        redirect: "bucket",
        meta: {
          permissionCode: "",
          title: "资源管理",
        },
        children: [
          {
            path: "bucket",
            component: () => import("@/views/resource/bucket/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Bucket",
              title: "资源块管理",
            },
          },
          {
            path: "dir",
            component: () => import("@/views/resource/dir-resource/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.DirResource",
              title: "资源目录管理",
            },
          },
          {
            path: "file",
            component: () => import("@/views/resource/file-resource/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.FileResource",
              title: "资源文件管理",
            },
          },
          {
            path: "attachment-config",
            component: () =>
              import("@/views/resource/attachment-config/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.AttachmentConfig",
              title: "附件配置管理",
            },
          },
          {
            path: "attachment",
            component: () => import("@/views/resource/attachment/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Attachment",
              title: "附件资源查询",
            },
          },
        ],
      },
      {
        path: "/organize/",
        redirect: "organization",
        meta: {
          permissionCode: "",
          title: "组织架构",
        },
        children: [
          {
            path: "organization",
            component: () => import("@/views/organize/organization/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Organization",
              title: "组织架构管理",
            },
          },
          {
            path: "org-users",
            component: () => import("@/views/organize/org-users/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Organization",
              title: "部门用户管理",
            },
          },
          {
            path: "enterprise",
            component: () => import("@/views/organize/enterprise/Index.vue"),
            meta: {
              permissionCode: "EcoSystem.Enterprise",
              title: "企业信息管理",
            },
          },
        ],
      },
      {
        path: "/report/",
        redirect: "category-config",
        meta: {
          permissionCode: "",
          title: "报表接口管理",
        },
        children: [
          {
            path: "category-config",
            component: () => import("@/views/report/category-config/Index.vue"),
            meta: {
              permissionCode: "",
              title: "报表分类管理",
            },
          },
          {
            path: "api-config",
            component: () => import("@/views/report/api-config/Index.vue"),
            meta: {
              permissionCode: "",
              title: "API接口管理",
            },
          },
          {
            path: "report-config",
            component: () => import("@/views/report/report-config/Index.vue"),
            meta: {
              permissionCode: "",
              title: "查询报表管理",
            },
          },
          {
            path: "query/:code",
            props: (app) => {
              return app.params;
            },
            component: () => import("@/views/report/query/Index.vue"),
            meta: {
              permissionCode: "",
              title: "报表查询模块",
            },
          },
        ],
      },
      {
        path: "/data-board/",
        redirect: "overview",
        meta: {
          permissionCode: "",
          title: "数据看板",
        },
        children: [
          {
            path: "overview",
            component: () => import("@/views/data-board/overview/Index.vue"),
            meta: {
              permissionCode: "",
              title: "数据概览",
            },
          }, {
            path: "history",
            component: () => import("@/views/data-board/history/Index.vue"),
            meta: {
              permissionCode: "",
              title: "历史数据管理",
            },
          },
        ],
      },
      {
        path: "/real-data/",
        redirect: "overview",
        meta: {
          permissionCode: "",
          title: "数据看板",
        },
        children: [
          {
            path: "source",
            component: () => import("@/views/real-data/source/Index.vue"),
            meta: {
              permissionCode: "",
              title: "污染源",
            },
          },
          {
            path: "environ-quality",
            component: () =>
              import("@/views/real-data/environ-quality/Index.vue"),
            meta: {
              permissionCode: "",
              title: "环境质量",
            },
          },
          {
            path: "aqi-topic",
            component: () => import("@/views/real-data/aqi-topic/Index.vue"),
            meta: {
              permissionCode: "",
              title: "AQI专题",
            },
          },
        ],
      },
      {
        path: "/gis-map/",
        redirect: "overview",
        meta: {
          permissionCode: "",
          title: "数据看板",
        },
        children: [
          {
            path: "source",
            component: () => import("@/views/gis-map/source/Index.vue"),
            meta: {
              permissionCode: "",
              title: "污染源专题",
            },
          },
          {
            path: "electricity",
            component: () => import("@/views/gis-map/electricity/Index.vue"),
            meta: {
              permissionCode: "",
              title: "用电量专题",
            },
          },
          {
            path: "water-quality",
            component: () =>
              import("@/views/gis-map/water-quality/Index.vue"),
            meta: {
              permissionCode: "",
              title: "水质专题",
            },
          },
          {
            path: "aqi-topic",
            component: () => import("@/views/gis-map/aqi-topic/Index.vue"),
            meta: {
              permissionCode: "",
              title: "AQI专题",
            },
          },
        ],
      },
    ],
  },
  {
    path: "/403",
    component: () => import("@/layout/views/error-403.vue"),
    meta: {
      permissionCode: "",
      allowAnonymous: true,
      title: "页面未找到",
    },
  },
  {
    path: "/:pathMatch(.*)",
    component: () => import("@/layout/views/error-404.vue"),
    meta: {
      permissionCode: "",
      allowAnonymous: true,
      title: "页面未找到",
    },
  },
];
